package com.hsogoo.collate.redis;

import org.springframework.beans.factory.annotation.Autowired;
import redis.clients.jedis.JedisCluster;

import java.util.Set;

/**
 * @Author huangsaigang
 * Created @2019-11-01.
 */
public class ClusterRedisClient implements RedisClient{

    @Autowired
    private JedisCluster jedisCluster;

    @Override
    public Boolean put(String key, String value) {
        String result = jedisCluster.set(key, value);
        return result.equals(SUCCESS);
    }

    @Override
    public Long sadd(String key, String... value) {
        return jedisCluster.sadd(key, value);
    }

    @Override
    public Set<String> sdiff(String ... keys){
        return jedisCluster.sdiff(keys);
    }

}
